package dr.mini.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import dr.mini.domain.MemberCommand;
@Component
public class MemberDaoImpl extends SqlSessionDaoSupport implements MemberDao{

	@Override
	public List<MemberCommand> getMemberList(Map<String, Object> map) {
		List<MemberCommand> list  = getSqlSession().selectList("getMemberList", map);
		return list;
	}

	@Override
	public int getMemberCount() {
		Integer count = getSqlSession().selectOne("getMemberCount");
		return count;
	}

	@Override
	public void insertMember(MemberCommand member) {
		getSqlSession().insert("insertMember", member);
		
	}

	@Override
	public MemberCommand getMember(String id) {
		MemberCommand member = getSqlSession().selectOne("getMember",id);
		return member;
	}

	@Override
	public void updateMember(MemberCommand member) {
		getSqlSession().update("updateMember", member);
		
	}

	@Override
	public void deleteMember(String id) {
		getSqlSession().delete("deleteMember", id);
	}

}
